package com.ybu.service.impl;

import com.ybu.common.ServiceCode;
import com.ybu.common.ServiceException;
import com.ybu.mapper.ProductCategoryMapper;
import com.ybu.pojo.vo.ProductCategoryVO;
import com.ybu.service.ProductCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ProductCategoryImpl implements ProductCategoryService {
    @Autowired
    private ProductCategoryMapper productCategoryMapper;
    @Override
    public List<ProductCategoryVO>getCategoryList(){
        List<ProductCategoryVO> categoryList = productCategoryMapper.getCategoryList();
        if(categoryList == null){
            throw new ServiceException(ServiceCode.ERR_NOT_FOUND,"没有商品分类信息");
        }
        return categoryList;
    }

}
